package com.zhangtai.modules.service.dimission;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.zhangtai.modules.entity.DimissionAndEmployeeInfoEntity;
import com.zhangtai.modules.entity.employee.DimissionEntity;
import com.zhangtai.modules.vo.DimissionEntityVo;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-04 10:30:33
 */

public interface DimissionService {

    @GetMapping("/findDimissionList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "date", required = false) String hiredate,
						 @RequestParam(value = "code", required = false) String code,
						 @RequestParam(value = "name", required = false) String name,
						 @RequestParam(value = "systemName", required = false) String systemName,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    
    @ApiOperation(value = "原生分页查询")
    PageResult<DimissionEntityVo> queryPageList(@RequestParam(value = "hiredate", required = false) Date hiredate,
			@RequestParam(value = "code", required = false) String code,
			@RequestParam(value = "name", required = false) String name,
			@RequestParam(value = "systemName", required = false) String systemName,
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                         @RequestParam(value = "orgIds") List<Long> orgIds
    );
    
    
    @ApiOperation(value = "根据工号获取员工离职bpm表单")
    R<DimissionEntityVo> employeeInfo(@RequestParam("userCode") String userCode,String name);
    
    @ApiOperation(value = "插入离职表、更新人员基础表或插入人员基础表")
    R insetDimissionAndEmployeeInfo(DimissionEntity data,HttpServletRequest request)throws Exception;
    
    @GetMapping("/infoDimission")
    @ApiOperation(value = "根据id查找")
        DimissionEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveDimission")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody DimissionEntity entity);

    @PostMapping("/updateDimission")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody DimissionEntity entity);

    @GetMapping("/deleteOneDimission")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteDimissions")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

